sea's blog → Algebra, Lisp, and miscellaneous thoughts

Table of Contents

General structure of elegant software:

I suspect that there is a way to formalize the general theory of elegant software using category theory and a few other bits and bobs, but for now I'll start with some lists and expand this as needed.

Configuration file

  1. Resides in `/etc/<program>`
  2. Has sample code in the repository within a `samples/<program.conf.example` file
  3. Configuration language is suitable for given problem, but default to Lisp for now.
  4. Has defaults specified. Final configuration is the unification of the two.

Logging

  1. Logs to stderr, stdout by default
  2. Accepts a `–quiet` parameter to inhibit stdout,stderr logging
  3. Accepts a `–verbose` parameter to increase logging intensity
  4. May accept a `–debug` paramter to further increase logging intensity
  5. Logs to `/var/log/<program>.log`
  6. Runs logrotate on that log at startup

Parameters

  1. Mandatory to accept: `–config, –debug, –verbose, –quiet, –log-file, –pid-file`

Documentation

  1. Versioned in the repository together with the code

Licensing

  1. GPL-compatible license, or AGPL-compatible

Testing

  1. Unit tests exist
  2. Pipeline runs unit tests
  3. In repo: Code will not merge unless all pipeline jobs succeed

Linting

  1. Maximum level of warnings and linting enabled

Security

  1. Least privilege required for any and all tasks
  2. Mandatory for all network connections to go over TLS
  3. Public-key cryptography mandatory in the case of user authentication or service-to-service

Packaging

  1. Packaged at least for one major distro family: RPM or DEB

Misc

  1. Compatible with the Red Hat / Fedora software packaging guidelines (has very strong requirements!)

Configuration file

  1. Resides in `/etc/<program>`
  2. Has sample code in the repository within a `samples/<program.conf.example` file
  3. Configuration language is suitable for given problem, but default to Lisp for now.
  4. Has defaults specified. Final configuration is the unification of the two.

Logging

  1. Logs to stderr, stdout by default
  2. Accepts a `–quiet` parameter to inhibit stdout,stderr logging
  3. Accepts a `–verbose` parameter to increase logging intensity
  4. May accept a `–debug` paramter to further increase logging intensity
  5. Logs to `/var/log/<program>.log`
  6. Runs logrotate on that log at startup

Parameters

  1. Mandatory to accept: `–config, –debug, –verbose, –quiet, –log-file, –pid-file`

Documentation

  1. Versioned in the repository together with the code

Licensing

  1. GPL-compatible license, or AGPL-compatible

Testing

  1. Unit tests exist
  2. Pipeline runs unit tests
  3. In repo: Code will not merge unless all pipeline jobs succeed

Linting

  1. Maximum level of warnings and linting enabled

Security

  1. Least privilege required for any and all tasks
  2. Mandatory for all network connections to go over TLS
  3. Public-key cryptography mandatory in the case of user authentication or service-to-service

Packaging

  1. Packaged at least for one major distro family: RPM or DEB

Misc

  1. Compatible with the Red Hat / Fedora software packaging guidelines (has very strong requirements!)